package com.heima.wemedia.controller.v1;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heima.apis.article.ArticleClient;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.WmNewsPageDto;
import com.heima.model.wemedia.pojos.WmNewsPage;
import com.heima.model.wemedia.pojos.WmUser;
import com.heima.utils.common.DateUtils;
import com.heima.utils.thread.WmThreadLocalUtil;
import com.heima.wemedia.service.WmStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.*;

@RestController
@RequestMapping("/api/v1/statistics")
public class WmStatisticsController {
    @Autowired
    private WmStatisticsService wmStatisticsService;

    //图文统计
    @GetMapping("/newsDimension")
    public ResponseResult newsDimension(String beginDate, String endDate) {
        return wmStatisticsService.newsDimension(beginDate,endDate);
    }

    //分页查询 图文统计
    @GetMapping("/newsPage")
    public PageResponseResult newsPage(WmNewsPageDto dto) {
        return wmStatisticsService.newsPage(dto);
    }

}
